echo "1、hd1_newpre
2、hd1_pre
3、hd1_prod
4、hd1_stress
5、hd1_test
6、运维集群
7、hn3_cicd
8、ht_test
9、cicd_old"


read -p "输入你要使用集群：" kubernetes_cluster


if [ $kubernetes_cluster -eq "1" ];then

    cat /root/.kube/hd1_newpre.config > /root/.kube/config
    echo -e "\e[32m完成\e[0m"


elif [ $kubernetes_cluster -eq 2 ];then
    cat /root/.kube/hd1_pre.config > /root/.kube/config
    echo -e "\e[32m完成\e[0m"


elif [ $kubernetes_cluster -eq 3 ];then
    cat /root/.kube/hd1_prod.config > /root/.kube/config
    read -p "$(echo -e '\e[31m生产环境，请注意！！，输入yes or no：\e[0m')" Confirm
    if [ $Confirm == "yes" ];then
	:
    elif [ $Confirm == "no" ];then
	exit

    else 
	echo "请输入正确的内容 yes or no"
    fi


    echo -e "\e[32m完成\e[0m"


elif [ $kubernetes_cluster -eq 4 ];then
    cat /root/.kube/hd1_stress.config > /root/.kube/config
    echo -e "\e[32m完成\e[0m"


elif [ $kubernetes_cluster -eq 5 ];then
    cat /root/.kube/hd1_test.config > /root/.kube/config
    echo -e "\e[32m完成\e[0m"
elif [ $kubernetes_cluster -eq 6 ];then
    cat /root/.kube/运维集群.config > /root/.kube/config
    echo -e "\e[32m完成\e[0m"
elif [ $kubernetes_cluster -eq 7 ];then
    cat /root/.kube/hn3_cicd.config > /root/.kube/config
    echo -e "\e[32m完成\e[0m"
elif [ $kubernetes_cluster -eq 8 ];then
    cat /root/.kube/ht_test.config > /root/.kube/config
    echo -e "\e[32m完成\e[0m"

elif [ $kubernetes_cluster -eq 9 ];then
    cat /root/.kube/cicd_old.config > /root/.kube/config
    echo -e "\e[32m完成\e[0m"

else
    echo -e "\e[31m请输入正确的数字\e[0m"


fi

# export KUBECONFIG=/root/.kube/$kubernetes_cluster


